# *-*- coding:utf-8 -*-
# @Author  : Eliza
# @Time    : 2021/7/18 17:53
# @Software : RubyMine

# module 不能有实例化的对象
# 同时使用include、 与extend
module F
  def f01
    puts "f01"
  end

  def self.included(flass)
    flass.extend FF

  end

  module FF
    def ff01
      puts "ff01"
    end
  end
end

class P
  included F
  F.included(self)

end

puts "=======P======="
p1 = P.new
puts P.superclass #Object
puts P.class #Class
puts P.included_modules #Kernel
puts "-------"
puts P.ancestors
#P
#Object
#Kernel
#BasicObject
# An object's singleton method ==its singleton class' instance method
# 一个对象的单例方法==它的单例类的实例方法